/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.ohyessoftware.sigc.infra.negocio;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Diego
 * 01/06/2011
 */
@Entity
@Table(name = "tipo_media", schema = "sigc")
public class TipoMedia implements Serializable{
    private static final long serialVersionUID = 1L;

    //atributos
    /******************************************************************************/
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "cod_tipo_media")
    private Long codTipoMedia;
    @Column(name = "nome")
    private String nome;
    @Column(name = "descricao")
    private String descricao;
    public Long getCodTipoMedia() {
        return codTipoMedia;
    }

    //relacoes
    /******************************************************************************/
    @OneToMany(mappedBy = "tipo_media", fetch = FetchType.LAZY)
    private List<Media> medias;

    //get e set
    /******************************************************************************/
    public void setCodTipoMedia(Long codTipoMedia) {
        this.codTipoMedia = codTipoMedia;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public List<Media> getMedia() {
        return medias;
    }

    public void setMedia(List<Media> media) {
        this.medias = media;
    }

}
